/**
 * Copyright (C) 2008 GeoScheduler Team, as stated on <http://www.geoscheduler.org/authors>.
 * 
 * This file is part of GeoScheduler.
 * 
 * GeoScheduler is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * GeoScheduler is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with GeoScheduler. If not, see <http://www.gnu.org/licenses/>.
 */

package org.geoscheduler.impl;

import java.util.Locale;

import org.geoscheduler.Context;
import org.geoscheduler.commons.marshaller.JSONMarshaller;
import org.geoscheduler.commons.msgs.JSONMessageMarshaller;
import org.geoscheduler.dao.AccountDAO;
import org.geoscheduler.dao.AccountLocationDAO;
import org.geoscheduler.dao.EventDAO;
import org.geoscheduler.dao.LocationDAO;
import org.geoscheduler.dao.TagDAO;
import org.geoscheduler.dao.TokenDAO;
import org.geoscheduler.model.Account;
import org.geoscheduler.security.authenticate.AuthenticatorProvider;
import org.geoscheduler.security.authorize.AuthorizationProvider;

/**
 * 
 * <h2>ContextImpl</h2>
 * <p>
 * Request context object implementation
 * </p>
 * @see Context
 * @author lko
 */
public class ContextImpl implements Context {

	private Account account;
	private Locale locale;
	private JSONMarshaller marshaller;
	private JSONMessageMarshaller msgMarshaller;
	private AccountDAO accountDAO;
	private EventDAO eventDAO;
	private LocationDAO locationDAO;
	private AccountLocationDAO accountLocationDAO;
	private TagDAO tagDAO;
	private TokenDAO tokenDAO;
	private AuthenticatorProvider authenticatorProvider;
	private AuthorizationProvider authorizationProvider;

	public ContextImpl() {
		super();
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public Locale getLocale() {
		// FIXME [lko] replace
		// return locale;
		return Locale.getDefault();
	}

	public void setLocale(Locale locale) {
		this.locale = locale;
	}

	public AccountDAO getAccountDAO() {
		return accountDAO;
	}

	public void setAccountDAO(AccountDAO accountDAO) {
		this.accountDAO = accountDAO;
	}

	public EventDAO getEventDAO() {
		return eventDAO;
	}

	public void setEventDAO(EventDAO eventDAO) {
		this.eventDAO = eventDAO;
	}

	public LocationDAO getLocationDAO() {
		return locationDAO;
	}

	public void setLocationDAO(LocationDAO locationDAO) {
		this.locationDAO = locationDAO;
	}

	public JSONMarshaller getMarshaller() {
		return marshaller;
	}

	public void setMarshaller(JSONMarshaller marshaller) {
		this.marshaller = marshaller;
	}

	public TagDAO getTagDAO() {
		return tagDAO;
	}

	public void setTagDAO(TagDAO tagDAO) {
		this.tagDAO = tagDAO;
	}

	public TokenDAO getTokenDAO() {
		return tokenDAO;
	}

	public void setTokenDAO(TokenDAO tokenDAO) {
		this.tokenDAO = tokenDAO;
	}

	public AuthenticatorProvider getAuthenticatorProvider() {
		return authenticatorProvider;
	}

	public void setAuthenticatorProvider(AuthenticatorProvider authenticatorProvider) {
		this.authenticatorProvider = authenticatorProvider;
	}

	public JSONMessageMarshaller getMsgMarshaller() {
		return msgMarshaller;
	}

	public void setMsgMarshaller(JSONMessageMarshaller msgMarshaller) {
		this.msgMarshaller = msgMarshaller;
	}

	public AccountLocationDAO getAccountLocationDAO() {
		return accountLocationDAO;
	}

	public void setAccountLocationDAO(AccountLocationDAO accountLocationDAO) {
		this.accountLocationDAO = accountLocationDAO;
	}

	public AuthorizationProvider getAuthorizationProvider() {
		return authorizationProvider;
	}

	public void setAuthorizationProvider(AuthorizationProvider authorizationProvider) {
		this.authorizationProvider = authorizationProvider;
	}
}
